<div class="layui-layout layui-layout-admin z-index-main">
    <div class="layui-header">
        <div class="z-logo">
            <img src="__IMG__/logo.png" height="37">
        </div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left" lay-filter="topNav">
            <li class="layui-nav-item onlyMobile">
                <a href="javascript:;"><span id="mobileNav">{$menus[0]['title']}</span></a>
                <dl class="layui-nav-child">
                    {foreach $menus as $menu}
                    {if $menu['type']==0}
                    <dd><a href="javascript:void(0);" data-menu="{$menu['menu_id']}">{$menu['title']}</a></dd>
                    {elseif $menu['type']==1}
                    <dd><a href="javascript:void(0);" data-href="{$menu['path']}">{$menu['title']}</a></dd>
                    {elseif $menu['type']==3}
                    <dd><a href="{$menu['path']}">{$menu['title']}</a></dd>
                    {elseif $menu['type']==4}
                    <dd><a href="{$menu['path']}" target="_blank">{$menu['title']}</a></dd>
                    {/if}
                    {/foreach}
                </dl>
            </li>
            {foreach $menus as $menu}
            {if $menu['type']==0}
            <li class="layui-nav-item onlyPc"><a href="javascript:void(0);" data-menu="{$menu['menu_id']}">{$menu['title']}</a></li>
            {elseif $menu['type']==1}
            <li class="layui-nav-item onlyPc"><a href="javascript:void(0);" data-href="{$menu['path']}">{$menu['title']}</a></li>
            {elseif $menu['type']==3}
            <li class="layui-nav-item onlyPc"><a href="{$menu['path']}">{$menu['title']}</a></li>
            {elseif $menu['type']==4}
            <li class="layui-nav-item onlyPc"><a href="{$menu['path']}" target="_blank">{$menu['title']}</a></li>
            {/if}
            {/foreach}
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img src="/storage/{$user->avatar}" onerror="this.src='__IMG__/avatar.png'" class="layui-nav-img">
                    <span class="onlyPc">{$user->email}({$user->user_id})</span>
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="javascript:void(0);" data-href="{:url('/Index/Index/Avatar')}">修改头像</a></dd>
                    <dd><a href="javascript:void(0);" data-href="{:url('/Index/Index/Info')}">资料设置</a></dd>
                    <dd><a href="javascript:void(0);" data-href="{:url('/Index/Index/Password')}">安全设置</a></dd>
                    <dd class="onlyMobile"><a href="{:url('/Index/Index/Logout')}">退出</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item onlyPc"><a href="{:url('/Index/Index/Logout')}">退出</a></li>
        </ul>
    </div>
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree" lay-filter="leftNav">
                {foreach $menus as $k=>$menu1}
                {if $menu1['type']==0&&$menu1['children']}
                {foreach $menu1['children'] as $menu2}
                {if $menu2['type']==0}
                <li class="layui-nav-item layui-nav-itemed {if $k!=0}hide{/if}" data-parent="{$menu1['menu_id']}">
                    <a href="javascript:void(0);">{$menu2['title']}</a>
                    {if $menu2['children']}
                    <dl class="layui-nav-child">
                        {foreach $menu2['children'] as $menu3}
                        {if $menu3['type']==1}
                        <dd><a href="javascript:void(0);" data-href="{$menu3['path']}">{$menu3['title']}</a></dd>
                        {elseif $menu3['type']==3}
                        <dd><a href="{$menu3['path']}">{$menu3['title']}</a></dd>
                        {elseif $menu3['type']==4}
                        <dd><a href="{$menu3['path']}" target="_blank">{$menu3['title']}</a></dd>
                        {/if}
                        {/foreach}
                    </dl>
                    {/if}
                </li>
                {elseif $menu2['type']==1}
                <li class="layui-nav-item {if $k!=0}hide{/if}" data-parent="{$menu1['menu_id']}"><a href="javascript:void(0);" data-href="{$menu2['path']}">{$menu2['title']}</a></li>
                {elseif $menu2['type']==3}
                <li class="layui-nav-item {if $k!=0}hide{/if}" data-parent="{$menu1['menu_id']}"><a href="{$menu2['path']}">{$menu2['title']}</a></li>
                {elseif $menu2['type']==4}
                <li class="layui-nav-item {if $k!=0}hide{/if}" data-parent="{$menu1['menu_id']}"><a href="{$menu2['path']}" target="_blank">{$menu2['title']}</a></li>
                {/if}
                {/foreach}
                {/if}
                {/foreach}
            </ul>
        </div>
    </div>
    <div class="site-tree-mobile layui-hide">
        <i class="layui-icon">&#xe602;</i>
    </div>
    <div class="site-mobile-shade"></div>
    <div class="layui-body">
        <div class="layui-tab" lay-allowClose="true" lay-filter="iframeTab">
            <ul class="layui-tab-title">
                <button class="layui-btn layui-btn-primary onlyPc" type="button" id="hideMenu">
                    <i class="layui-icon layui-icon-shrink-right"></i>
                </button>
                <button class="layui-btn layui-btn-primary onlyPc hide" type="button" id="showMenu">
                    <i class="layui-icon layui-icon-spread-left"></i>
                </button>
                <button class="layui-btn layui-btn-primary onlyPc" type="button" id="openNew">
                    <i class="layui-icon layui-icon-link"></i>
                </button>
                <button class="layui-btn layui-btn-primary onlyPc" type="button" id="refresh">
                    <i class="layui-icon layui-icon-refresh-3"></i>
                </button>
                <li class="layui-this">欢迎回来<i class="layui-tab-close" style="display: none"></i></li>
            </ul>
            <div class="layui-tab-content" id="iframeContent">
                <div class="layui-tab-item layui-show" lay-id="_index_index_welcome.html"><iframe src="{:url('/Index/Index/Welcome')}"></iframe></div>
            </div>
        </div>
    </div>
    <div class="layui-footer onlyPc">
        {$Think.FOOTER|raw}
    </div>
</div>